# Maintainer: Muflone http://www.muflone.com/contacts/english/
# Contributor: Ian Guthrie <iguthrie [at] aol [dot] com>
# Contributor: der_FeniX <derfenix [at] gmail [dot] com>

pkgname=perl-filesys-df
_perl_namespace=Filesys
_perl_module=Df
pkgver=0.92
pkgrel=13
pkgdesc="Perl extension for filesystem disk space information"
arch=('loong64' 'x86_64')
url="https://metacpan.org/release/${_perl_namespace}-${_perl_module}"
license=('PerlArtistic' 'GPL')
depends=('perl')
source=("https://www.cpan.org/modules/by-module/${_perl_namespace}/${_perl_namespace}-${_perl_module}-${pkgver}.tar.gz")
sha256sums=('fe89cbb427e0e05f1cd97c2dd6d3866ac6b21bc7a85734ede159bdc35479552a')
options=('!emptydirs')

build() {
  cd "${_perl_namespace}-${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  perl Makefile.PL
  make
}

check() {
  cd "${_perl_namespace}-${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}

package() {
  cd "${_perl_namespace}-${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  make pure_install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
}
